package com.atguigu.springcloud.controller;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope  //刷新config远程中心配置的注解
public class ConfigClientController {

    @Value("${server.port}")
    private String serverPort;

    /*
     * 获取配置文件的的属性
     * ${config.info}取出相应的值。
     * */
    @Value("${config.server.info}")
    private String configInfo;

    @GetMapping("/configInfo")
    public String getConfigInfo(){
        return configInfo;
    }
}
